gl: Don't accidentally use ints for float variables
authorBenjamin Otte <otte@redhat.com>
Sun, 8 Jul 2018 14:52:33 +0000 (16:52 +0200)
committerBenjamin Otte <otte@redhat.com>
Fri, 13 Jul 2018 12:56:04 +0000 (14:56 +0200)
The int was floor()ing the x/y coordinates of glyphs, which could cause
significant repositioning of glyphs when text was scaled via the MVP.

gsk/gl/gskglrenderer.c

index 76a54728deb2b47b98e2f161c37051c9339670e0..718cc0965e60caf4cbc4399e208971194c345617 100644 (file)
@@ -385,8 +385,8 @@ render_text_node (GskGLRenderer   *self,
   guint num_glyphs = gsk_text_node_get_num_glyphs (node);
   int i;
   int x_position = 0;
-  int x = gsk_text_node_get_x (node) + builder->dx;
-  int y = gsk_text_node_get_y (node) + builder->dy;
+  float x = gsk_text_node_get_x (node) + builder->dx;
+  float y = gsk_text_node_get_y (node) + builder->dy;
 
   /* If the font has color glyphs, we don't need to recolor anything */
   if (!force_color && font_has_color_glyphs (font))
@@ -405,7 +405,7 @@ render_text_node (GskGLRenderer   *self,
     {
       const PangoGlyphInfo *gi = &glyphs[i];
       const GskGLCachedGlyph *glyph;
-      int glyph_x, glyph_y, glyph_w, glyph_h;
+      float glyph_x, glyph_y, glyph_w, glyph_h;
       float tx, ty, tx2, ty2;
       double cx;
       double cy;